The puzzle object links a crossword matrix to a dictionary and a search. The puzzle has various inspectable parameters that the user can set to control the type of search.
Here are the routines that put together the search. The biggest step is extracting the squares and words from the puzzle. Then the search is initialized and executed.
*/
- newSearch: sender
{
id stateType, searchType;
StopWatch * watch;
[search free];
[state free];
[crossword clear: [inspector getColor: 0]];
switch ([inspector getStateType])
{
case PLAIN: stateType = [PlainState class]; break;
case BACKJUMP: stateType = [BackjumpState class]; break;
case LEAPFROG: stateType = [LeapfrogState class]; break;
default: stateType = nil; break;
}
switch ([inspector getOption: BROADENING])
{
case NO: searchType = [DepthFirstSearch class]; break;
case YES: searchType = [BroadeningSearch class]; break;